"use client";

import type * as React from "react";

import {
  useLinkToolbarButton,
  useLinkToolbarButtonState,
} from "@platejs/link/react";
import { Link } from "lucide-react";

import { ToolbarButton } from "./toolbar";

export function LinkToolbarButton(
  props: React.ComponentProps&lt;typeof ToolbarButton&gt;,
) {
  const state = useLinkToolbarButtonState();
  const { props: buttonProps } = useLinkToolbarButton(state);

  return (
    &lt;ToolbarButton {...props} {...buttonProps} data-plate-focus tooltip="Link"&gt;
      &lt;Link /&gt;
    &lt;/ToolbarButton&gt;
  );
}
